package com.zmj.controller;

import com.zmj.common.Res;
import com.zmj.entity.Price;
import com.zmj.service.PriceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/price")
public class PriceController {
    @Autowired
    PriceService priceService;

    @GetMapping("/info")
    public Res getPrice(){
        List<Price> list = priceService.getPrice();
        if (list != null){
            return Res.create(1,"价格",list);
        }else {
            return Res.create(0,"？？？",null);
        }
    }
}
